<%--
  Created by IntelliJ IDEA.
  User: kkk
  Date: 2022/11/21
  Time: 16:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="${pageContext.request.contextPath}/statics/layui/layui.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/statics/layui/css/layui.css">
    <link rel="shortcut icon" href="${pageContext.request.contextPath}/statics/images/ico/favicon.ico">
    <script src="${pageContext.request.contextPath}/statics/js/jquery-3.4.1.min.js"></script>
</head>
<body class="gray-bg">
<form class="layui-form">
    <div class="layui-form-item">
        <label class="layui-form-label">编号</label>
        <div class="layui-input-inline">
            <input type="text" name="userId" lay-verify="title" value="${tsysUser.userId}" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">账号</label>
        <div class="layui-input-inline">
            <input type="text" name="loginName" lay-verify="title" value="${tsysUser.loginName}" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">用户昵称</label>
        <div class="layui-input-inline">
            <input type="text" name="userName" value="${tsysUser.userName}" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">用户类型</label>
        <div class="layui-input-inline">
            <input type="text" name="userType" value="${tsysUser.userType}" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">用户邮箱</label>
        <div class="layui-input-inline">
            <input type="text" name="email" value="${tsysUser.email}" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">手机电话</label>
        <div class="layui-input-inline">
            <input type="text" name="phonenumber" value="${tsysUser.phonenumber}" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">性别</label>
        <div class="layui-input-inline">
            <input type="radio" name="sex" value="1" title="女" ${tsysUser.sex=="1"? "checked":""}>
            <input type="radio" name="sex" value="0" title="男" ${tsysUser.sex=="0"? "checked":""}>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-inline">
            <input type="text" name="password" value="${tsysUser.password}" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">账号状态</label>
        <div class="layui-input-inline">
            <input type="text" name="status" value="${tsysUser.status}" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-inline">
            <textarea name="remark" value="${tsysUser.remark}" autocomplete="off"
                      class="layui-input"></textarea>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-inline">
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            <button type="reset" class="layui-btn layui-btn-normal" onclick="history.back()">返回</button>
        </div>
    </div>
</form>
<script>
    layui.use(['form','jquery'], function(){
        var form = layui.form;
        var $ = layui.jquery;
        form.on('submit(demo1)',function (data) {
            $.get("${pageContext.request.contextPath}/tSysUser/edit",data.field,function (data) {
                if (data==="1"){
                    alert("修改成功");
                    location.href="${pageContext.request.contextPath}/tSysUser/toList";
                }else {
                    alert("修改失败");
                    location.href="${pageContext.request.contextPath}/tSysUser/toList";
                }
            })
        })
    })
</script>
</body>
</html>
